import requests

#   构建正文
param = {'username': 'admin', 'password': 'admin', 'savelogin': 'true'}
# param = 'username=admin&password=admin&savelogin=true'    #结果:user_invalid
#   发送POST请求
r = requests.post('http://localhost/agileone/index.php/common/login', data=param, allow_redirects=False)
#   获取响应内容
# print(r.text)
# print(r.cookies)
# print(r.cookies['PHPSESSID'])
# print(r.is_redirect)
